Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2304 enhancement announced blocks parallel download #2320

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

ErakhtinB
Copy link
Contributor

@ErakhtinB ErakhtinB commented Dec 20, 2024

Closes #2304

Referenced issues

To decrease time lag between block announcement and downloading the full block, we start to download blocks not only from the peer that announced the block but also from a number of random active peers, all in parallel. Downloading from random peer might be faster than the one announced the block. The number is configurable by cli.

Description of the Change

Possible Drawbacks

Checklist Before Opening a PR

Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? [Yes|No]
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? [Yes|No]
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? [Yes|No]
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. [Yes|No]

@ErakhtinB ErakhtinB linked an issue Dec 20, 2024 that may be closed by this pull request
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from 0e9a69d to 41a51d1 Compare December 26, 2024 08:06
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch 4 times, most recently from c725e95 to 0513601 Compare December 26, 2024 09:09
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from 0513601 to 7714e61 Compare December 26, 2024 09:22
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from e481912 to 8d9f2c6 Compare December 26, 2024 09:35
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from 99d72bb to bc1d0b5 Compare December 26, 2024 15:00
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from bc1d0b5 to 35daeb7 Compare December 26, 2024 15:05
turuslan
turuslan previously approved these changes Dec 26, 2024
core/network/impl/synchronizer_impl.cpp Outdated Show resolved Hide resolved
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from a3b9c38 to ab41109 Compare December 27, 2024 14:42
@turuslan turuslan dismissed their stale review December 27, 2024 16:04

Wrong changes

@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from 85e0195 to b5630f4 Compare December 31, 2024 11:18
core/network/impl/synchronizer_impl.cpp Show resolved Hide resolved
core/network/impl/synchronizer_impl.cpp Show resolved Hide resolved
core/network/impl/synchronizer_impl.cpp Outdated Show resolved Hide resolved
core/network/impl/synchronizer_impl.cpp Outdated Show resolved Hide resolved
@ErakhtinB ErakhtinB force-pushed the 2304-enhancement-announced-blocks-parallel-download branch from ae0cc66 to 63bdc91 Compare January 6, 2025 08:14
core/network/impl/synchronizer_impl.cpp Show resolved Hide resolved
core/network/impl/synchronizer_impl.cpp Outdated Show resolved Hide resolved
@ErakhtinB ErakhtinB enabled auto-merge (squash) January 10, 2025 08:32
for (const auto &p_id : selected_peers) {
loadBlocks(p_id, block_info, [wp{weak_from_this()}](auto res) {
if (auto self = wp.lock()) {
SL_TRACE(self->log_, "Block(s) enqueued to apply by announce");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res contains either information about block's number and hash that was downloaded or error.
This information could be added to log message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Announced blocks parallel download
3 participants